<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('法人姓名')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-contact_name" class="form-control" name="row[contact_name]" type="text" value="{$row.contact_name|htmlentities}">
            </div>
        </div>
<!--        <div class="form-group">-->
<!--            <label class="control-label col-xs-12 col-sm-2">{:__('Contact_id_doc_type')}:</label>-->
<!--            <div class="col-xs-12 col-sm-8">-->
<!--                <input id="c-contact_id_doc_type" class="form-control" name="row[contact_id_doc_type]" type="text" value="{$row.contact_id_doc_type|htmlentities}">-->
<!--            </div>-->
<!--        </div>-->
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('身份证件号码')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-contact_id_number" class="form-control" name="row[contact_id_number]" type="text" value="{$row.contact_id_number|htmlentities}">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('证件正面照片')}:</label>
            <div class="col-xs-12 col-sm-8">
                <div class="input-group">
                    <input id="c-contact_id_doc_copy" class="form-control" size="50" name="row[contact_id_doc_copy]" type="text" value="{$row.contact_id_doc_copy|htmlentities}">
                    <div class="input-group-addon no-border no-padding">
                        <span><button type="button" id="faupload-contact_id_doc_copy" class="btn btn-danger faupload" data-input-id="c-contact_id_doc_copy" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-contact_id_doc_copy"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                        <span><button type="button" id="fachoose-contact_id_doc_copy" class="btn btn-primary fachoose" data-input-id="c-contact_id_doc_copy" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                    </div>
                    <span class="msg-box n-right" for="c-contact_id_doc_copy"></span>
                </div>
                <ul class="row list-inline faupload-preview" id="p-contact_id_doc_copy"></ul>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('证件反面照片')}:</label>
            <div class="col-xs-12 col-sm-8">
                <div class="input-group">
                    <input id="c-contact_id_doc_copy_back" class="form-control" size="50" name="row[contact_id_doc_copy_back]" type="text" value="{$row.contact_id_doc_copy_back|htmlentities}">
                    <div class="input-group-addon no-border no-padding">
                        <span><button type="button" id="faupload-contact_id_doc_copy_back" class="btn btn-danger faupload" data-input-id="c-contact_id_doc_copy_back" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-contact_id_doc_copy_back"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                        <span><button type="button" id="fachoose-contact_id_doc_copy_back" class="btn btn-primary fachoose" data-input-id="c-contact_id_doc_copy_back" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                    </div>
                    <span class="msg-box n-right" for="c-contact_id_doc_copy_back"></span>
                </div>
                <ul class="row list-inline faupload-preview" id="p-contact_id_doc_copy_back"></ul>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('证件有效期开始时间')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-contact_period_begin" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[contact_period_begin]" type="text" value="{$row.contact_period_begin}">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('证件有效期结束时间')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-contact_period_end" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[contact_period_end]" type="text" value="{$row.contact_period_end}">
            </div>
        </div>
        <div class="form-group">
            <div class="col-xs-12 col-sm-8 col-sm-offset-2">
                <label>
                    <input type="checkbox" id="long-term-checkbox1"> 长期
                </label>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('身份证居住地址法人')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-id_card_address" class="form-control" name="row[id_card_address]" type="text" value="{$row.id_card_address|htmlentities}">
            </div>
        </div>
<!--        <div class="form-group">-->
<!--            <label class="control-label col-xs-12 col-sm-2">{:__('Business_authorization_letter')}:</label>-->
<!--            <div class="col-xs-12 col-sm-8">-->
<!--                <input id="c-business_authorization_letter" class="form-control" name="row[business_authorization_letter]" type="text" value="{$row.business_authorization_letter|htmlentities}">-->
<!--            </div>-->
<!--        </div>-->
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('联系手机')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-mobile_phone" class="form-control" name="row[mobile_phone]" type="text" value="{$row.mobile_phone|htmlentities}">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('联系邮箱')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-contact_email" class="form-control" name="row[contact_email]" type="text" value="{$row.contact_email|htmlentities}">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('主体类型')}:</label>
            <div class="col-xs-12 col-sm-8">
                <select id="c-subject_type" class="form-control" name="row[subject_type]">
                    <option value="SUBJECT_TYPE_INDIVIDUAL" {$row.subject_type == 'SUBJECT_TYPE_INDIVIDUAL' ? 'selected' : ''}>个体户、个体工商户、个体经营</option>
                    <option value="SUBJECT_TYPE_ENTERPRISE" {$row.subject_type == 'SUBJECT_TYPE_ENTERPRISE' ? 'selected' : ''}>有限公司、有限责任公司</option>
                    <option value="SUBJECT_TYPE_GOVERNMENT" {$row.subject_type == 'SUBJECT_TYPE_GOVERNMENT' ? 'selected' : ''}>政府机关</option>
                    <option value="SUBJECT_TYPE_INSTITUTIONS" {$row.subject_type == 'SUBJECT_TYPE_INSTITUTIONS' ? 'selected' : ''}>事业单位</option>
                    <option value="SUBJECT_TYPE_OTHERS" {$row.subject_type == 'SUBJECT_TYPE_OTHERS' ? 'selected' : ''}>社会团体、民办非企业、基金会、基层群众性自治组织、农村集体经济组织等</option>
                </select>
            </div>
<!--            <div class="col-xs-12 col-sm-8">-->
<!--                <input id="c-subject_type" class="form-control" name="row[subject_type]" type="text" value="{$row.subject_type|htmlentities}">-->
<!--            </div>-->
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('营业执照照片')}:</label>
            <div class="col-xs-12 col-sm-8">
                <div class="input-group">
                    <input id="c-license_copy" class="form-control" size="50" name="row[license_copy]" type="text" value="{$row.license_copy|htmlentities}">
                    <div class="input-group-addon no-border no-padding">
                        <span><button type="button" id="faupload-license_copy" class="btn btn-danger faupload" data-input-id="c-license_copy" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-license_copy"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                        <span><button type="button" id="fachoose-license_copy" class="btn btn-primary fachoose" data-input-id="c-license_copy" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                    </div>
                    <span class="msg-box n-right" for="c-license_copy"></span>
                </div>
                <ul class="row list-inline faupload-preview" id="p-license_copy"></ul>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('注册号/统一社会信用代码')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-license_number" class="form-control" name="row[license_number]" type="text" value="{$row.license_number|htmlentities}">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('商户名称')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-merchant_name" class="form-control" name="row[merchant_name]" type="text" value="{$row.merchant_name|htmlentities}">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('所属行业')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-qualification_type" data-source="wanlshop.shop/qualification_type"  data-field="industry_name" data-rule="required"
                       class="form-control selectpage" class="form-control" name="row[qualification_type]" type="text" value="{$row.qualification_type|htmlentities}">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('注册地址')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-license_address" class="form-control" name="row[license_address]" type="text" value="{$row.license_address|htmlentities}">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('有效期限开始日期')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-license_period_begin" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[license_period_begin]" type="text" value="{$row.license_period_begin|htmlentities}">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('有效期限结束日期')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-license_period_end" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[license_period_end]" type="text" value="{$row.license_period_end|htmlentities}">
            </div>
        </div>
        <div class="form-group">
            <div class="col-xs-12 col-sm-8 col-sm-offset-2">
                <label>
                    <input type="checkbox" id="long-term-checkbox"> 长期
                </label>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('登记证书照片')}:</label>
            <div class="col-xs-12 col-sm-8">
                <div class="input-group">
                    <input id="c-cert_copy" class="form-control" size="50" name="row[cert_copy]" type="text" value="{$row.cert_copy|htmlentities}">
                    <div class="input-group-addon no-border no-padding">
                        <span><button type="button" id="faupload-cert_copy" class="btn btn-danger faupload" data-input-id="c-cert_copy" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-cert_copy"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                        <span><button type="button" id="fachoose-cert_copy" class="btn btn-primary fachoose" data-input-id="c-cert_copy" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                    </div>
                    <span class="msg-box n-right" for="c-cert_copy"></span>
                </div>
                <ul class="row list-inline faupload-preview" id="p-cert_copy"></ul>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('登记证书类型')}:</label>
            <div class="col-xs-12 col-sm-8">
            <select id="c-cert_type" class="form-control" name="row[cert_type]">
                <option value="">请选择</option>
                <option value="CERTIFICATE_TYPE_2388" {$row.cert_type == 'CERTIFICATE_TYPE_2388' ? 'selected' : ''}>事业单位法人证书</option>
                <option value="CERTIFICATE_TYPE_2389" {$row.cert_type == 'CERTIFICATE_TYPE_2389' ? 'selected' : ''}>统一社会信用代码证书</option>
                <option value="CERTIFICATE_TYPE_2394" {$row.cert_type == 'CERTIFICATE_TYPE_2394' ? 'selected' : ''}>社会团体法人登记证书</option>
                <option value="CERTIFICATE_TYPE_2395" {$row.cert_type == 'CERTIFICATE_TYPE_2395' ? 'selected' : ''}>民办非企业单位登记证书</option>
                <option value="CERTIFICATE_TYPE_2396" {$row.cert_type == 'CERTIFICATE_TYPE_2396' ? 'selected' : ''}>基金会法人登记证书</option>
                <option value="CERTIFICATE_TYPE_2520" {$row.cert_type == 'CERTIFICATE_TYPE_2520' ? 'selected' : ''}>执业许可证/执业证</option>
                <option value="CERTIFICATE_TYPE_2521" {$row.cert_type == 'CERTIFICATE_TYPE_2521' ? 'selected' : ''}>基层群众性自治组织特别法人统一社会信用代码证</option>
                <option value="CERTIFICATE_TYPE_2522" {$row.cert_type == 'CERTIFICATE_TYPE_2522' ? 'selected' : ''}>农村集体经济组织登记证</option>
                <option value="CERTIFICATE_TYPE_2399" {$row.cert_type == 'CERTIFICATE_TYPE_2399' ? 'selected' : ''}>宗教活动场所登记证</option>
                <option value="CERTIFICATE_TYPE_2400" {$row.cert_type == 'CERTIFICATE_TYPE_2400' ? 'selected' : ''}>政府部门下发的其他有效证明文件</option>
            </select>
            </div>
<!--            <div class="col-xs-12 col-sm-8">-->
<!--                <input id="c-cert_type" class="form-control" name="row[cert_type]" type="text" value="{$row.cert_type|htmlentities}">-->
<!--            </div>-->
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('证书号')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-cert_number" class="form-control" name="row[cert_number]" type="text" value="{$row.cert_number|htmlentities}">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('登记证书的注册地址')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-company_address" class="form-control" name="row[company_address]" type="text" value="{$row.company_address|htmlentities}">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('有效期限开始日期')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-certificate_period_begin" class="form-control datetimepicker" data-date-format="YYYY-MM-DD " data-use-current="true" name="row[certificate_period_begin]" type="text" value="{$row.certificate_period_begin|htmlentities}">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('有效期限结束日期')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-certificate_period_end" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[certificate_period_end]" type="text" value="{$row.certificate_period_end|htmlentities}">
            </div>
        </div>
        <div class="form-group">
            <div class="col-xs-12 col-sm-8 col-sm-offset-2">
                <label>
                    <input type="checkbox" id="long-term-checkbox2"> 长期
                </label>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('账户类型')}:</label>
            <div class="col-xs-12 col-sm-8">
                <select id="c-bank_account_type" class="form-control" name="row[bank_account_type]">
                    <option value="">请选择</option>
                    <option value="BANK_ACCOUNT_TYPE_CORPORATE" {$row.bank_account_type == 'BANK_ACCOUNT_TYPE_CORPORATE' ? 'selected' : ''}>对公银行账户</option>
                    <option value="BANK_ACCOUNT_TYPE_PERSONAL" {$row.bank_account_type == 'BANK_ACCOUNT_TYPE_PERSONAL' ? 'selected' : ''}>经营者个人银行卡</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('银行账号')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-account_number" class="form-control" name="row[account_number]" type="text" value="{$row.account_number|htmlentities}">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('银行名称')}:</label>
            <div class="col-xs-12 col-sm-8">
                <select id="c-account_bank" class="form-control" name="row[account_bank]">
                    <option value="">请选择</option>
                    <option value="工商银行" {$row.account_bank == '工商银行' ? 'selected' : ''}>工商银行</option>
                    <option value="交通银行" {$row.account_bank == '交通银行' ? 'selected' : ''}>交通银行</option>
                    <option value="招商银行" {$row.account_bank == '招商银行' ? 'selected' : ''}>招商银行</option>
                    <option value="民生银行" {$row.account_bank == '民生银行' ? 'selected' : ''}>民生银行</option>
                    <option value="中信银行" {$row.account_bank == '中信银行' ? 'selected' : ''}>中信银行</option>
                    <option value="浦发银行" {$row.account_bank == '浦发银行' ? 'selected' : ''}>浦发银行</option>
                    <option value="兴业银行" {$row.account_bank == '兴业银行' ? 'selected' : ''}>兴业银行</option>
                    <option value="光大银行" {$row.account_bank == '光大银行' ? 'selected' : ''}>光大银行</option>
                    <option value="广发银行" {$row.account_bank == '广发银行' ? 'selected' : ''}>广发银行</option>
                    <option value="平安银行" {$row.account_bank == '平安银行' ? 'selected' : ''}>平安银行</option>
                    <option value="北京银行" {$row.account_bank == '北京银行' ? 'selected' : ''}>北京银行</option>
                    <option value="华夏银行" {$row.account_bank == '华夏银行' ? 'selected' : ''}>华夏银行</option>
                    <option value="农业银行" {$row.account_bank == '农业银行' ? 'selected' : ''}>农业银行</option>
                    <option value="建设银行" {$row.account_bank == '建设银行' ? 'selected' : ''}>建设银行</option>
                    <option value="邮政储蓄银行" {$row.account_bank == '邮政储蓄银行' ? 'selected' : ''}>邮政储蓄银行</option>
                    <option value="中国银行" {$row.account_bank == '中国银行' ? 'selected' : ''}>中国银行</option>
                    <option value="宁波银行" {$row.account_bank == '宁波银行' ? 'selected' : ''}>宁波银行</option>
                    <option value="其他银行" {$row.account_bank == '其他银行' ? 'selected' : ''}>其他银行</option>
                </select>
<!--                <input id="c-account_bank" class="form-control" name="row[account_bank]" type="text" value="{$row.account_bank|htmlentities}">-->
            </div>
        </div>

        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('开户银行省市编码')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-bank_address_code" class="form-control" name="row[bank_address_code]" type="text" value="{$row.bank_address_code|htmlentities}">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('开户银行联行号')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-bank_branch_id"  data-source="bank/branch/index" class="form-control selectpage" name="row[bank_branch_id]" type="text" value="{$row.bank_branch_id|htmlentities}">
                "17家直连银行无需填写，如为其他银行，则开户银行全称（含支行）和 开户银行联行号二选一 2、需填写银行全称，如"深圳农村商业银行XXX支行"
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('开户银行全称（含支行）')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-bank_name" class="form-control" name="row[bank_name]" type="text" value="{$row.bank_name|htmlentities}">
            </div>
        </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('抽成比例')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-take-proportion" data-rule="required" class="form-control" name="row[take_proportion]" type="text" value="{$row.take_proportion|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('分佣类型')}:</label>
        <div class="col-xs-12 col-sm-8">
            <label class="radio-inline">
                <input type="radio" name="row[sharing_type]" value="1" {if $row.sharing_type == 1}checked{/if} > {:__('按比例分佣')}
            </label>
<!--            <label class="radio-inline">-->
<!--                <input type="radio" name="row[sharing_type]" value="2" {if $row.sharing_type == 2}checked{/if} > {:__('按单品分佣')}-->
<!--            </label>-->
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('分佣比例')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-sharing-proportion" data-rule="required" class="form-control" name="row[sharing_proportion]" type="text" value="{$row.sharing_proportion|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <div style="padding: 0 150px;color: red">抽佣比例+分佣比例最大百分比不可超过30%，且设置比例时候注意该商家为平台设置的最大分账比例，填写比例相加超过商家设定的比例后将无法进行分账</div>
    </div>
    <div class="form-group" id="points-deduction">
        <label  class="control-label col-xs-12 col-sm-2">{:__('积分最多抵扣百分比')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-points_deduction" class="form-control" data-rule="required"  name="row[points_deduction]" type="number" value="{$row.points_deduction|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <div style="padding: 0 150px;color: red">百分比是平台抽佣金额的百分比。例如 ：商品金额100元平台抽佣10元，那么百分比就是10元的可抵扣百分比</div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('商品分类')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-category_id" data-source="wanlshop.shop/category"
                   class="form-control selectpage" class="form-control" name="row[category_id]" type="text" value="{$row.category_id|htmlentities}">
        </div>
    </div>

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
            <button type="button" id="check-status" class="btn btn-primary btn-embossed" data-id="{$id}" >{:__('查询申请状态')}</button>
            {if $row.status == 'hidden'}
            <button type="button" id="check-chong" class="btn btn-primary btn-embossed" data-id="{$id}" >{:__('重新提交申请')}</button>
            {/if}
        </div>
    </div>
</form>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js"></script>
<script>
    document.getElementById('long-term-checkbox').addEventListener('change', function() {
        var endDateInput = document.getElementById('c-license_period_end');
        if (this.checked) {
            endDateInput.value = '长期';
            endDateInput.disabled = true;
        } else {
            endDateInput.value = '';
            endDateInput.disabled = false;
        }
    });
    document.addEventListener('DOMContentLoaded', function() {
        var endDateInput = document.getElementById('c-license_period_end');
        var longTermCheckbox = document.getElementById('long-term-checkbox');

        // 检查是否已经是长期
        if (endDateInput.value === '长期') {
            endDateInput.value = '长期';
            longTermCheckbox.checked = true;
            endDateInput.disabled = true;
        }

        // 监听复选框的变化
        longTermCheckbox.addEventListener('change', function() {
            if (this.checked) {
                endDateInput.value = '长期';
                endDateInput.disabled = true;
            } else {
                endDateInput.value = '';
                endDateInput.disabled = false;
            }
        });
    });
    $(document).ready(function() {
        $('#check-status').click(function() {
            var id = $(this).data('id');
            console.log(id,'98989898989')
            $.ajax({
                url: 'wanlshop/shop/endpoint',  // 替换为你的接口地址
                type: 'POST',  // 或 'POST'，根据你的接口要求
                data: {
                    shop_id:id
                },
                success: function(response) {
                    // 处理接口响应
                    console.log(response);
                    if (response.code === 1) {
                        toastr.success(response.msg, 'Success');
                    } else {
                        toastr.error(response.msg, 'Error');
                    }
                },
                error: function(xhr, status, error) {
                    // 处理错误
                    console.error(xhr);
                    alert('请求出错');
                }
            });
        });
        $('#check-chong').click(function() {
            var id = $(this).data('id');
            console.log(id,'98989898989')
            $.ajax({
                url: 'wanlshop/shop/application',  // 替换为你的接口地址
                type: 'POST',  // 或 'POST'，根据你的接口要求
                data: {
                    shop_id:id
                },
                success: function(response) {
                    // 处理接口响应
                    console.log(response);
                    if (response.code === 1) {
                        toastr.success('申请已重新提交', 'Success');
                    } else {
                        toastr.error(response.msg, 'Error');
                    }
                },
                error: function(xhr, status, error) {
                    // 处理错误
                    console.error(xhr);
                    alert('请求出错');
                }
            });
        });
        if ($('#c-contact_period_end').val() === '长期') {
            $('#long-term-checkbox1').prop('checked', true);
            $('#c-contact_period_end').prop('disabled', true);
        }
        $('#long-term-checkbox1').change(function() {
            if ($(this).is(':checked')) {
                $('#c-contact_period_end').val('长期').prop('disabled', true);
            } else {
                $('#c-contact_period_end').val('').prop('disabled', false);
            }
        });


        if ($('#long-term-checkbox1').is(':checked')) {
            $('#c-contact_period_end').val('长期').prop('disabled', true);
        }
        if ($('#c-certificate_period_end').val() === '长期') {
            $('#long-term-checkbox2').prop('checked', true);
            $('#c-certificate_period_end').prop('disabled', true);
        }

        $('#long-term-checkbox2').change(function() {
            if ($(this).is(':checked')) {
                $('#c-certificate_period_end').val('长期').prop('disabled', true);
            } else {
                $('#c-certificate_period_end').val('').prop('disabled', false);
            }
        });
        if ($('#long-term-checkbox2').is(':checked')) {
            $('#c-certificate_period_end').val('长期').prop('disabled', true);
        }
    });
</script>
